<a href="<?php echo $this->url(array('action' => 'index'), 'example_action'); ?>"><?php echo BaseZF::escape(_('Back to example index')); ?></a>


<ul>
    <li><a href="<?php echo BaseZF::escape($this->url()); ?>"><?php echo BaseZF::escape(_('Create a new Example'));?></a></li>
</ul>

<form action="<?php echo $this->url(); ?>" method="get">
<fieldset>
    <legend>
    <?php echo BaseZF::escape(_('Search Examples:')) . ' '; ?>
<?php
    if ($this->search_example->nb_results > 0) {
        echo BaseZF::escape(sprintf(_('%d result found'), $this->search_example->nb_results));
    } else {
        echo BaseZF::escape(_('No result found'));
    }
?>
    </legend>
    <table>
        <th><?php echo BaseZF::escape(_('Field:')); ?></th>
        <td>
            <?php
                $search_field_values = array();
                echo $this->formSelect('search_field', $this->params['search_field'], array(), $search_field_values);
            ?>
        </td>
        <th><?php echo BaseZF::escape(_('Value:')); ?></th>
        <td>
            <?php
                echo $this->formText('search_value', $this->params['search_value'], array());
            ?>
        </td>
        <td>
            <?php echo $this->formSubmit('submit', 'Search'); ?>
            <?php echo $this->formReset('cancel', 'Cancel'); ?>
        </td>
    </table>
</fieldset>
</form>


<table>
    <tr>
        <th>#</th>
        <th><a href="" ><?php echo $this->paginationOrderLink($this, 'name',  _('Name'), 'example_search_example_model', $this->pagination_params, $this->search_example); ?></a></th>
        <th><a href="" ><?php echo BaseZF::escape(_('Description')); ?></a></th>
        <th><a href="" ><?php echo BaseZF::escape(_('Creation')); ?></a></th>
        <th><a href="" ><?php echo BaseZF::escape(_('Email')); ?></a></th>
        <th><a href="" ><?php echo BaseZF::escape(_('Status')); ?></a></th>
    </tr>
<?php

    if ($this->search_example->nb_results > 0) {
        foreach ($this->search_example->results as $example) {
?>
    <tr>
        <td><?php echo BaseZF::escape($example->name); ?></td>
        <td><?php echo BaseZF::escape($example->description); ?></td>
        <td><?php echo BaseZF::escape($example->creation); ?></td>
        <td><?php echo BaseZF::escape($example->email); ?></td>
        <td><?php echo BaseZF::escape($example->active); ?></td>
    </tr>
<?php
        }
    } else {
?>
    <tr>
        <td><?php echo BaseZF::escape(_('No result found')); ?></td>
    </tr>
<?php
    }
?>
</table>


<?php
    $route_params = array();
    echo $this->paginationSelect($this, 'example_search_example_model', $this->pagination_params, $this->search_example);
?>

<ul>
    <li><a onclick="window.open(this.href); return false;" href="http://basezf.japanim.fr/doc/html/searchexamplemodel_8php-source.html"><?php echo BaseZF::escape(_('See view source')); ?></a></li>
    <li><a onclick="window.open(this.href); return false;" href="http://basezf.japanim.fr/doc/html/classExampleController.html"><?php echo BaseZF::escape(_('See action source')); ?></a></li>
</ul>

